package com.ruoyi.consumer.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consumer.mapper.COrderMapper;
import com.ruoyi.consumer.domain.COrder;
import com.ruoyi.consumer.service.ICOrderService;

/**
 * 支付订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-19
 */
@Service
public class COrderServiceImpl implements ICOrderService 
{
    @Autowired
    private COrderMapper cOrderMapper;

    /**
     * 查询支付订单
     * 
     * @param orderId 支付订单主键
     * @return 支付订单
     */
    @Override
    public COrder selectCOrderByOrderId(Integer orderId)
    {
        return cOrderMapper.selectCOrderByOrderId(orderId);
    }

    /**
     * 查询支付订单列表
     * 
     * @param cOrder 支付订单
     * @return 支付订单
     */
    @Override
    public List<COrder> selectCOrderList(COrder cOrder)
    {
        return cOrderMapper.selectCOrderList(cOrder);
    }

    /**
     * 新增支付订单
     * 
     * @param cOrder 支付订单
     * @return 结果
     */
    @Override
    public int insertCOrder(COrder cOrder)
    {
        cOrder.setCreateTime(DateUtils.getNowDate());
        return cOrderMapper.insertCOrder(cOrder);
    }

    /**
     * 修改支付订单
     * 
     * @param cOrder 支付订单
     * @return 结果
     */
    @Override
    public int updateCOrder(COrder cOrder)
    {
        cOrder.setUpdateTime(DateUtils.getNowDate());
        return cOrderMapper.updateCOrder(cOrder);
    }

    /**
     * 批量删除支付订单
     * 
     * @param orderIds 需要删除的支付订单主键
     * @return 结果
     */
    @Override
    public int deleteCOrderByOrderIds(Integer[] orderIds)
    {
        return cOrderMapper.deleteCOrderByOrderIds(orderIds);
    }

    /**
     * 删除支付订单信息
     * 
     * @param orderId 支付订单主键
     * @return 结果
     */
    @Override
    public int deleteCOrderByOrderId(Integer orderId)
    {
        return cOrderMapper.deleteCOrderByOrderId(orderId);
    }
}
